package com.wawayaya.api.remote;

import android.content.Context;

import com.creative.accountsdk.UserData;
import com.wawayaya.api.ApiRequestHelper;
import com.wawayaya.api.ApiRequestParams;
import com.wawayaya.api.interf.ApiResponseJsonListener;
import com.wawayaya.bean.User;
import com.wawayaya.cache.UserDataCache;
import com.wawayaya.util.TLog;

import org.json.JSONObject;

import java.util.Date;

/**
 * Created by creative on 15/11/9.
 * 家长中心/教师中心 网络请求
 */
public class ApiParentTeacher {

    /**
     * 家长、教师中心首页request
     *
     * @param
     */
    public static void indexChome(Context context, ApiResponseJsonListener apiResponseJsonListener) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.gettpHomeData(), context, params, ApiConstans.INDEX_HOME, apiResponseJsonListener);
    }


    /**
     * 家长教师中心选书首页获取可选书列表
     */

    public static void getBookListToChoose(Context context, ApiResponseJsonListener apiResponseJsonListener) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListToChoose(), context, params, ApiConstans.TP_LIB, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取主题类书架书本列表
     */

    public static void getBookListFromThemeLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromThemeLib(), context, params, ApiConstans.TP_THEME_LIB_BOOKS, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取系列类书架书本列表
     */

    public static void getBookListFromSeriesLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromSeriesLib(), context, params, ApiConstans.TP_SERIES_LIB_BOOKS, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取推荐类书架书本列表
     */

    public static void getBookListFromRecommendLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromRecommendLib(), context, params, ApiConstans.TP_RECOMMEND_LIB_BOOKS, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取分龄类书架书本列表
     */

    public static void getBookListFromAgeLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromAgeLib(), context, params, ApiConstans.TP_AGE_LIB_BOOKS, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取年级类书架书本列表
     */

    public static void getBookListFromGradeLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromGradeLib(), context, params, ApiConstans.TP_GRADE_LIB_BOOKS, apiResponseJsonListener);
    }

    /**
     * 家长教师中心选书首页获取英文类书架书本列表
     */

    public static void getBookListFromEnglishLib(Context context, ApiResponseJsonListener apiResponseJsonListener, Long bs_id) {
        ApiRequestParams params = new ApiRequestParams();
        UserData user = UserData.getInstance();
        params.put("id", bs_id);
        params.put("userId", user.getUid());
        params.put("pctoken", user.getToken());
        params.put("bklang", "en");

        ApiRequestHelper.getTeacherHandler(ApiConstans.getTpBookListFromEnglishLib(), context, params, ApiConstans.TP_ENG_LIB_BOOKS, apiResponseJsonListener);
    }













}
